package com.weipai.springboot.module.service.impl;

import com.weipai.springboot.enums.RetCode;
import com.weipai.springboot.model.Brand;
import com.weipai.springboot.model.News;
import com.weipai.springboot.model.api.Response;
import com.weipai.springboot.module.mapper.NewsMapper;
import com.weipai.springboot.module.service.NewsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * Created by ${lyh} on 2018/8/28.
 */
@Service
public class NewsServiceImpl implements NewsService{

    @Autowired
    NewsMapper newsMapper;


    @Override
    public List<News> selectAllByNewsTypes(String userId, String types) {
        return newsMapper.selectAllByNewsTypes(userId,types);
    }

    //查询物流详情
    @Override
    public Response getLogisticsById(String id) {
        Response response = new Response();
        News news = newsMapper.selectByPrimaryKey(id);
        if(null!=news){
            response.setCode(RetCode.SUCCESS);
        }else {
            response.setCode(RetCode.NO_DATA);
        }
        return response;
    }
}
